/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.umss.arqui10.testCaseUse;

import edu.umss.arqui10.JAlgo;
import edu.umss.arqui10.modelo.Service;
import edu.umss.arqui10.modelo.ServiceReceiver;
import java.math.BigDecimal;
import java.util.Collection;

/**
 *
 * @author rho1and0
 */
public class ServiceTestCaseUse {
    public static void main(String [] args) {
        JAlgo a = new JAlgo();
        a.addService(new Long(0), "servicio1", "servicio de Prueba", new BigDecimal(20.0));
        a.addService(new Long(1), "servicio2", "servicio de Prueba", new BigDecimal(21.0));
        a.addService(new Long(2), "servicio3", "servicio de Prueba", new BigDecimal(21.0));
        a.addService(new Long(3), "servicio4", "servicio de Prueba", new BigDecimal(21.0));

        Collection c = a.getServices();
        for(Object o : c.toArray()) {
            System.out.println(((Service)o).getName());
        }

        ServiceReceiver sr = new ServiceReceiver("Juan Perez");
        sr.createHistory();
        sr.openRegistry("temperatura = 36.6");
        sr.assignService((Service)c.toArray()[2]);

        System.out.println(sr.getService("servicio3"));
    }
}